<include file="public@header"/>
<style>
    td{text-align: center}
</style>
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('Member/index')}">用户管理</a></li>
    </ul>

    <form class="well form-inline margin-top-20" method="post" action="{:url('member/member/index')}">

        关键字：
        <input class="form-control" type="text" name="keyword" style="width: 200px;" value="{:input('request.keyword')}"
               placeholder="请输入要搜索的用户名">
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="{:url('member/index')}">清空</a>
    </form>


    <form method="post" class="js-ajax-form">
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th align="left" abbr="user_id" axis="col3" class="">
                    <div style="text-align: center; width: 100%;" class="">ID</div>
                </th>
                <th align="left" abbr="nickname" axis="col4" class="">
                    <div style="text-align: center; width:  100%;" class="">用户名</div>
                </th>
                <th align="left" abbr="nickname" axis="col4" class="">
                    <div style="text-align: center; width:  100%;" class="">性别</div>
                </th>
<!--                <th align="center" ab   br="mobile" axis="col6" class="">-->
<!--                    <div style="text-align: center; width:  100%;" class="">学历</div>-->
<!--                </th>-->
<!--                <th align="center" axis="col1" class="">-->
<!--                    <div style="text-align: center; width:  100%;">年龄</div>-->
<!--                </th>-->

                <th align="center" axis="col1" class="">
                    <div style="text-align: center; width:  100%;">手机号码</div>
                </th>
                <th align="center" axis="col1" class="">
                    <div style="text-align: center; width:  100%;">邮箱</div>
                </th>
                <th align="center" axis="col1" class="">
                    <div style="text-align: center; width:  100%;">创建时间</div>
                </th>
                <th align="center" axis="col1" class="">
                    <div style="text-align: center; width:  100%;">{:lang('STATUS')}</div>
                </th>
                <th align="center" axis="col1" class="">
                    <div style="text-align: center; width:  100%;">操作</div>
                </th>

            </tr>
            </thead>
            <tbody>
            <php>
                $user_statuses=array("0"=>lang('拉黑'),"1"=>lang('正常'),"2"=>lang('未验证'));
            </php>
            <foreach name="list" item="vo" key="k" >
                <tr>
                    <td>{$vo.id}</td>
                    <td>{$vo.user_nickname}</td>
                     <td>
                    <switch name="vo.sex">
                        <case value="1">
                            <span class="label btn-primary">男</span>
                        </case>
                        <case value="2">
                            <span class="label label-danger">女</span>
                        </case>
                    </switch>
                    </td>
                    <td>{$vo.mobile}</td>
                    <td>{$vo.user_email}</td>
                    <td>{:date('Y-m-d H:i:s',$vo['create_time'])}</td>
                    <td>
                        <switch name="vo.user_status">
                            <case value="0">
                                <span class="label label-danger">{$user_statuses[$vo['user_status']]}</span>
                            </case>
                            <case value="1">
                                <span class="label label-success">{$user_statuses[$vo['user_status']]}</span>
                            </case>
                            <case value="2">
                                <span class="label label-warning">{$user_statuses[$vo['user_status']]}</span>
                            </case>
                        </switch>
                    </td>
                    <td>
                        <neq name="vo.id" value="1">
                            <a class="btn btn-xs btn-success" href="{:url('member/detail', ['id' => $vo.id])}">详情</a>
                            <empty name="vo.user_status">
                                <a class="btn btn-xs btn-success js-ajax-dialog-btn"
                                   href="{:url('member/cancelban',array('id'=>$vo['id']))}"
                                   data-msg="{:lang('确定要启次用户吗')}">{:lang('启用')}</a>
                                <else/>
                                <a class="btn btn-xs btn-warning js-ajax-dialog-btn"
                                   href="{:url('member/ban',array('id'=>$vo['id']))}"
                                   data-msg="{:lang('确定要拉黑此用户吗')}">{:lang('拉黑')}</a>
                            </empty>
                            <else/>
                            <a class="btn btn-xs btn-warning disabled">{:lang('BLOCK_USER')}</a>
                        </neq>
                    </td>

                </tr>
            </foreach>
            </tbody>
        </table>
        <div class="pagination">{$page}</div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>